﻿CREATE TABLE [lodr].[VROOM_CONFIG]
(
	[Id]							INT CONSTRAINT PK_VROOM_CONFIG_Id PRIMARY KEY IDENTITY(1,1),
	
	[SourceSystem]					NVARCHAR(32)   NOT NULL,
	[SourceType]					NVARCHAR(32)   NOT NULL,
	[DestinationType]				NVARCHAR(32)   NOT NULL,

	[Source]						NVARCHAR(256)  NOT NULL,
	[Destination]					NVARCHAR(128)  NOT NULL,

	[SourceHeaderRowCount]			INT			   NULL,
	[DestinationConnectionAlias]	NVARCHAR(512)  NULL,
		
	[MappingsOverrides]				XML			   NULL,
	[ColumnMappingType]				NVARCHAR(32)   NULL,
	[ExplicitNullColumns]			XML			   NULL,

	[Comments]						NVARCHAR(1024) NULL,
	[IsEnabled]						SMALLINT	   NOT NULL CONSTRAINT [DF_VROOM_CONFIG_IsEnabled] DEFAULT(0), 

	CONSTRAINT UNQ_VROOM_CONFIG_Unique UNIQUE NONCLUSTERED ([Source], [Destination])
)